from functools import total_ordering

class Room:
    def __init__(self, length, width):
        self.length = length
        self.width = width

    @property
    def square_feet(self):
        return self.length * self.width

@total_ordering
class House:
    def __init__(self, name):
        self.name = name
        self.rooms = []

    def __repr__(self):
        return 'House name is {}'.format(self.name)

    @property
    def square_feet(self):
        return sum(r.square_feet for r in self.rooms)

    def AddRoom(self, room):
        self.rooms.append(room)

    def __eq__(self, other):
        return self.square_feet == other.square_feet

    def __lt__(self, other):
        return self.square_feet < other.square_feet


if '__main__' == __name__:
    h1 = House('House1')
    h1.AddRoom(Room(1, 2))
    h1.AddRoom(Room(2, 3))
    h2 = House('House2')
    h2.AddRoom(Room(1, 2))
    h2.AddRoom(Room(2, 3))

    print(h1 == h2)
